package com.example.common.exception;

import com.example.common.enums.ResponseEnum;

/**
 * 自定义业务异常
 */
public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private Integer code;
    private String message;

    public BusinessException() {
        this.code = ResponseEnum.BUSINESS_ERROR.getCode();
        this.message = ResponseEnum.BUSINESS_ERROR.getMsg();
    }

    public BusinessException(String message) {
        super(message);
        this.code = ResponseEnum.BUSINESS_ERROR.getCode();
        this.message = message;
    }
}
